Transcoding in security camera applications

ABSTRACT

The disclosure is related to adaptive transcoding of video streams from a camera. A camera system includes a camera and a base station connected to each other in a first communication network, which can be a wireless network. When a user requests to view a video from the camera, the base station obtains a video stream from the camera, transcodes the video stream, based on one or more input parameters, to generate a transcoded video stream, and transmits the transcoded video stream to a user device. The base station can transcode the video stream locally, e.g., within the base station, or in a cloud network based on transcoding location factors. Further, the camera system can also determine whether to stream the video to the user directly from the base station or from the cloud network based on streaming location factors.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application claims the benefit of U.S. Provisional PatentApplication No. 62/633,017, entitled “OPTIMIZATION AND TESTING OFWIRELESS DEVICES” filed on Feb. 20, 2018, which is incorporated byreference herein in its entirety.

TECHNICAL FIELD

The disclosure is related to transcoding a video stream captured from asecurity camera.

BACKGROUND

Transcoding is a process of decoding an encoded content and thenaltering the decoded content based on one or more requirement andencoding the altered content. As an example, using transcoding the audioand/or video format (codec) may be changed from one to another, such asconverting from an MPEG2 source (commonly used in broadcast television)to H.264 video and AAC audio codes, which may be used for streaming.Other basic tasks could include adding watermarks, logos, or othergraphics to your video. A video streaming service, such as a moviestreaming service, uses transcoding to typically stream videos todifferent types of user devices, such as smartphones, laptops, smarttelevisions (TVs). For example, if the content to be streamed is of aresolution 4K (ultra-high-definition), not all user devices may becapable streaming the content smoothly. The viewers without sufficientnetwork bandwidth may not be able to view the stream as their playersmay be buffering the content constantly as they wait for packets of that4K video to arrive or devices with lower resolution may not be able tothe view the content at all. Accordingly, the video streaming servicemay transcode the content to generate multiple video streams of variousbit rates or resolution, e.g., 1080p, 720p, and send the appropriatestream to the user devices.

However, the current transcoding techniques do not adapt to the changein environment, e.g., representative of various user device or networkparameters, in which the streaming is performed. For example, consider auser would like to view a live video stream from a security camerainstalled at a home of the user on a user device such as a smartphone.When a data rate associated with a network to which the smartphone isconnected decreases, the current techniques do not get a feedback of thechange in data rate and therefore, continues with the streaming at asame bit rate or resolution of the video, which results in loss of videoframes or video being jittery or stuck. That is, the current transcodingtechniques are not optimized based on the dynamic nature of theenvironment. Further, the current transcoding techniques typicallyperform transcoding in a cloud server, which is typically in a networkdifferent from that of a source of the content, and that adds to thelatency in streaming the content. The current transcoding techniques donot have the capability to perform the transcoding closer to the sourceof the content, e.g., in the same network, or at a device associatedwith a device that generates the content, and therefore, areinefficient.

SUMMARY

The disclosure is related to adaptive transcoding of video streams froma camera. A camera system includes a camera and a base station connectedto each other in a first network, which can be a wireless local areanetwork (WLAN). When a user requests for a video from the camera, thebase station obtains a video stream from the camera, transcodes thevideo stream within the base station to generate a transcoded videostream, and transmits the transcoded video stream to a user device. Theuser device can be any computing device associated with the user, suchas a smartphone, a laptop, a tablet personal computer (PC), or a smartTV.

The base station performs the transcoding based on one or more inputparameters of an environment in which the video streaming is performed,such as network parameters associated with the first network, networkparameters associated with a second network to which the user device isconnected, parameters associated with the user device. The base stationcan also adapt the transcoding to a change in one or more of the inputparameters. For example, if a speed, e.g., a data rate, of the secondnetwork decreases from a first bit rate to a second bit rate, the basestation can automatically learn of the decrease in the speed of thesecond network, and transcode the video stream by decreasing aresolution and/or bit rate of the video stream to generate an adjustedtranscoded video stream. Similarly, the transcoding can increase theresolution and/or the bit rate back up when the speed of the secondnetwork improves. While speed of the second network is one of the inputparameters to which the transcoding can dynamically adapt, thetranscoding can be adapt to various other input parameters, such as theones mentioned above.

Further, the base station can also dynamically determine whether tostream the transcoded video stream directly to the user device, e.g.,using a peer-to-peer (P2P) streaming technique, or via a video streamingserver located in a cloud network based on streaming location factors.For example, if the base station determines that the user device is inthe same network, e.g., LAN, as the base station or if a latency or aload associated with the video streaming server is above a specifiedthreshold, the base station can stream the transcoded video stream tothe user device using the P2P streaming technique. In another example,if the base station determines that the user device is in a network thatdoes not support P2P streaming, or if the user device is experiencingdata loss in receiving the video stream directly, the base station cantransmit the transcoded video stream to the video streaming server forstreaming to the user device.

Furthermore, the base station can also determine whether to perform thetranscoding locally, e.g., at the base station, or using a server in acloud network, based on transcoding location factors. For example, ifthe availability of resources at the base station, e.g., processingcapacity, memory, for performing the transcoding is unavailable or belowa specified threshold, or if the transcoding to a particularrequirement, e.g., codec, is unavailable, the base station can determineto have the video stream transcoded at the server in the cloud network.In another example, if the base station determines that a latency or aload associated with the server is above a specified threshold, or ifthere is a licensing cost associated with transcoding at the server orif the licensing cost is above a specified threshold, the base stationcan determine to transcode the video stream at the base station.

The base station can continuously monitor the input parameters, thestreaming location factors, and the transcoding location factors, e.g.,by obtaining feedback from the user device or an access point of thenetwork to which the user device is connected, and dynamically adapt thetranscoding based on the input parameters.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram illustrating an environment in whichtranscoding of a video stream in a camera system having a base stationcan be implemented.

FIG. 1B is a block diagram illustrating streaming of a transcoded videostream via a cloud network, consistent with various embodiments.

FIG. 2 is a block diagram of an example in the which transcoding of avideo stream is performed in a video streaming server in a cloudnetwork, consistent with various embodiments.

FIG. 3 is a block diagram of the base station of FIG. 1A, consistentwith various embodiments.

FIG. 4 is a flow diagram of a process for transcoding a video stream ina camera system having a base station, consistent with variousembodiments.

FIG. 5 is a flow diagram of a process for dynamically adapting thetranscoding of a video stream, consistent with various embodiments.

FIG. 6 is a flow diagram of a process for determining a transcodinglocation of a video stream, consistent with various embodiments.

FIG. 7 is a block diagram of a computer system as may be used toimplement features of some embodiments of the disclosed technology.

DETAILED DESCRIPTION

FIG. 1A is a block diagram illustrating an environment in whichtranscoding of a video stream in a camera system having a base stationcan be implemented. The environment 100 includes a camera system havinga base station 105 and a camera 110. In some embodiments, the camerasystem is a security camera system that can be installed in a building,e.g., a house. The base station 105 and the camera 110 can be connectedto each other using a first network 125. The first network 125 can be alocal area network (LAN). In some embodiments, the first network 125 isa wireless LAN (WLAN), such as a home Wi-Fi, created by an access point120. The camera 110 and the base station 105 can be connected to eachother wirelessly, e.g., over Wi-Fi, or using wired means. The basestation 105 and the camera 110 can be connected to each other wirelesslyvia the access point 120, or directly with each other without the accesspoint 120, e.g., using Wi-Fi direct, Wi-Fi ad hoc or similar wirelessconnection technologies. Further, the base station 105 can be connectedto the first network 125 using a wired means or wirelessly.

The camera 110 captures video and transmits the video to the basestation 105 as a video stream 130. The camera 110 can encode the videostream 130 using any codec, e.g., H.264. Further, a file format of thevideo stream 130 can be one of many formats, e.g., AVI, MP4, MOV, WMA,or MKV. The video stream 130 can include audio as well if the camera 110has audio capabilities, e.g., a speaker and/or a microphone. The camera110 can be battery powered or powered from a wall outlet. The camera 110can include one or more sensors, e.g., a motion sensor that can activatethe recording of the video when a motion is detected. The camera 110 caninclude infrared (IR) light emitting diode (LED) sensors, which canprovide night-vision capabilities. Although the environment 100illustrates a single camera 110, the camera system can include multiplecameras (which can be installed at various locations of a building).Further, all the cameras in the camera system can have same features, orat least some of the cameras can have different features. For example,one camera can have a night-vision feature while another may not. Onecamera can be battery powered while another may be powered from the walloutlet.

The base station 105 can be a computer system that securely connects thecamera 110 to the Internet via the access point 120. The base station105 can provide various features such as long range wirelessconnectivity to the camera 110, a local storage device 115, a siren,connectivity to network attached storage (NAS), and enhance battery lifeof the camera 110, e.g., by making the camera 110 work efficiently andkeeping the communications between the base station 105 and the camera110 efficient. The base station 105 can be configured to store the videocaptured from the camera 110 in any of the local storage device 115, theNAS, or a cloud storage service. The base station 105 can be configuredto generate a sound alarm from the siren when an intrusion is detectedby the base station 105 based on the video stream 130 receive from thecamera 110.

Another feature of the base station 105 is that it can create its ownnetwork within the first network 125, so that the camera 110 may notoverload or consume the network bandwidth of the first network 125. Thecamera 110 typically connects to the base station 105 wirelessly. Thefirst network 125 can include multiple base stations to increasewireless coverage of the base station 105, which may be beneficial orrequired in cases where the cameras are spread over a large area.

When a user 170 sends a request, e.g., from a user device 165, to view alive video feed from the camera 110, the base station 105 receives therequest and in response to receiving the request, obtains the videostream 130 from the camera 110, transcodes 135 the video stream 130 togenerate a transcoded video stream 150, and streams the transcoded videostream 150 to the user device 165. Upon receiving the transcoded videostream 150 at the user device 165, a video player application in theuser device 165 decodes the transcoded video stream 150 and plays thevideo on a display on the user device 165 for the user 170 to view. Theuser device 165 can be any computing device that can connect to anetwork and play video content, such as a smartphone, a laptop, adesktop, a tablet personal computer (PC), or a smart TV.

Although the video stream 130 is described as a live or real-time videostream from the camera 110, the video stream 130 is not limited toreal-time video stream, it can be a video stream retrieved from thestorage device 115, the NAS or the cloud storage service.

The base station 105 can stream the transcoded video stream 150 to theuser device 165 in multiple ways. For example, the base station 105 canstream the transcoded video stream to the user device 165 using P2Pstreaming technique. In P2P streaming, when the video player on the userdevice 165 requests the video stream 130, the base station 105 and theuser device 165 continuously exchange signaling information 155 via aserver 160 in a cloud network 140 to determine the location informationof the base station 105 and the user device 165 for each other, to finda best path and establish a connection to route the transcoded videostream 150 from the base station 105 to the user device 165. Afterestablishing the connection, the base station 105 streams the transcodedvideo stream 150 to the user device 165, eliminating the additionalbandwidth cost to deliver the transcoded video stream 150 from the basestation 105 to a video streaming server in the cloud network 140 and forstreaming from the video streaming server to the user device 165. Theserver 160 keeps a log of available peer node servers to route the videostream and establishes the connection between the user device 165 andthe peers. The server 160 is a signaling server or can include signalingsoftware whose function is to maintain and manage a list of peers andhandle the signaling 155 between the base station 105 and the userdevice 165. In some embodiments, the server 160 can dynamically selectthe best peers based on geography and network topology.

In some embodiments, the cloud network 140 is a network of resourcesfrom a centralized third-party provider using Wide Area Networking (WAN)or Internet-based access technologies. Cloud networking is related theconcept of cloud computing, in which the network or computing resourcesare shared across various customers or clients. The cloud network 140 isdistinct, independent, and different from that of the first network 125.

In another example of streaming the video to the user device 165, thebase station 105 can stream the transcoded video stream 150 to the userdevice 165 via a video streaming server 180 in the cloud network 140 asillustrated in FIG. 1B, FIG. 1B is a block diagram illustratingstreaming of a transcoded video stream via a cloud network, consistentwith various embodiments. When the video player on the user device 165requests the video stream 130, the base station 105 uploads thetranscoded video stream 150 to the video streaming server 180 in thecloud network 140, which further streams the transcoded video stream 150to the user device 165. The user device 165 maintains a continuousconnection with the video streaming server 180 to receive the transcodedvideo stream 150.

The transcoded video stream 150 can be streamed from the base station105 or from the video streaming server 180. The base station 105 candetermine the “streaming from” location, e.g., the base station 105 orthe video streaming server 180, based on a streaming location parameter.The streaming location parameter is evaluated based on one or morestreaming location factors and is evaluated to one of two values, e.g.,Boolean values such as true or false, 0 or 1, “LOCAL” or “REMOTE,” etc.If the base station 105 determines that the streaming location parameteris of a first value, e.g., LOCAL, then the streaming is performed fromthe base station 105. However, if the streaming location parameter is ofa second value, e.g., REMOTE, then the base station 105 instructs thevideo streaming server 180 to perform the streaming. Note that theevaluation function can consider one streaming location factor or acombination of streaming location factors in determining the value.Also, in some embodiments, the user 170 may customize the evaluationfunction to determine a specific value for specific combination ofstreaming location factors.

The streaming location parameter is evaluated based on one or morestreaming factors, which include user device parameters such as alocation of the user device 165; network parameters of the cloud network140 such as a latency of with the video streaming server 180, a loadassociated with the video streaming server 180; network parametersassociated with the client network 175 such as whether the clientnetwork 175 permits P2P streaming, etc. For example, if the base station105 determines that the user device 165 is in the first network 125, thebase station 105 determines the streaming location parameter to be“LOCAL,” which indicates that the base station 105 streams thetranscoded video stream 150 to the user device 165, e.g., using P2Pstreaming technique. In another example, if the base station 105determines that a latency or load associated with the video streamingserver 180 is above a specified threshold, the base station 105determines the streaming location parameter to be “LOCAL”. In anotherexample, if the base station 105 determines that the client network 175to which the user device 165 is connected does not support P2Pstreaming, the base station 105 determines the streaming locationparameter to be “REMOTE,” which indicates that the base station 105 hasinstructed the video streaming server 180 to stream the transcoded videostream 150. In another example, if the user device 165 is experiencingdata loss in receiving the transcoded video stream 150 directly from thebase station 105, the base station 105 determines the streaming locationparameter to be “REMOTE”.

In some embodiments, the base station 105 can dynamically determine the“streaming from” location. That is, the base station 105 cancontinuously monitor the streaming location factors, evaluate thestreaming location parameter, and update the “streaming from” locationas and when the streaming location parameter changes.

Referring to the transcoding 135, the base station 105 performs thetranscoding 135 so that the transcoded video stream 150 is in a formthat is suitable for transmission to and consumption by the user device165. That is, the transcoding 135 converts the video stream 130 from afirst form to a second form. Different user devices can have differenthardware or software capabilities. For example, the user 170 can have afirst user device with a first resolution, e.g., 4K resolution (e.g.,3840 pixels×2160), and a second user device with a second resolution,e.g., 720p (e.g., 1280×720). If the video stream 130 streamed is of 4Kresolution, the video stream 130 may not be viewable on the second userdevice which is of a lower resolution. Similarly, if a data rate of theclient network 175 is of a first data rate, e.g., 3 Mbps, and if thevideo stream 130 streamed to the user device is of 4K resolution at 13Mbps, the video stream 130 may not be playable or may constantly bufferat the user device 165. Accordingly, the base station 105 determines toperform the transcoding 135 based on one or more input parameters, suchas user device parameters, server parameters, network parametersassociated with the first network 125, network parameters associatedwith the cloud network 140, and network parameters associated with theclient network 175, to generate the transcoded video stream 150 that isin a form suitable for transmission to and consumption by the userdevice 165.

Continuing with the above example of user devices having two differentresolutions, if the second user device having 720p resolution requeststhe video stream 130, the transcoding 135 transcodes the video stream130 to change the resolution of the video from 4K (first form) to 720p(second form) and generates the transcoded video stream 150 having thevideo at the 720p resolution. If the user 170 requests the video stream130 from multiple user devices simultaneously, the transcoding 135 cangenerate multiple transcoded video streams 150, one stream at 4Kresolution for a 4K resolution user device and another stream at 720presolution for 720p resolution device.

As another example of transcoding based on user device parameters, ifthe video stream 130 from the camera 110 is of MPEG2 format, but theuser device 165 supports H.264 and AAC codec, the transcoding 135 canconvert the video stream from the MPEG2 format (first form) to R264video and AAC audio (second form).

As an example of transcoding based on network parameters associated withthe first network 125, the transcoding 135 can transcode the videostream 130 based on a data rate, e.g., uplink data rate of the firstnetwork 125. In some embodiments, the uplink data rate of the firstnetwork 125 is a data rate at which data can be uploaded from a devicethe first network 125 to another device outside of the first network125. The transcoding 135 can transcode the video stream 130 to a datarate not higher than the uplink data rate of the first network 125. Forexample, if the uplink data rate is a maximum of 6 Mbps and if thesource video stream 130 is of 4K resolution at 13 Mbps (first form), thetranscoding 135 can transcode the video stream 130 to ensure that thetranscoded video stream 150 has bit rates not exceeding the uplink datarate by a specified threshold (which is user configurable), e.g.,Full-HD resolution at 6 Mbps, or other renditions at 3 Mbps, 1.8 Mbps, 1Mbps, 600 kbps etc. (second form).

As an example of transcoding based on network parameters associated withthe client network 175, the transcoding 135 can transcode the videostream 130 based on a data rate, e.g., downlink data rate of the firstnetwork 125. In some embodiments, the downlink data rate of the clientnetwork 175 includes a data rate at which data can be downloaded by adevice in the client network 175. The transcoding 135 can transcode thevideo stream 130 to a data rate not higher than the downlink data rateof the client network 175. For example, if the downlink data rate is amaximum of 6 Mbps and if the source video stream 130 is of 4K resolutionat 13 Mbps, the transcoding 135 can transcode the video stream 130 toensure that the transcoded video stream 150 has bit rates not exceedingthe downlink data rate by a specified threshold (which is userconfigurable), e.g., Full-HD resolution at 6 Mbps, or other renditionsat 3 Mbps, 1.8 Mbps, 1 Mbps, 600 kbps etc.

As another example of transcoding based on network parameters associatedwith the client network 175, the transcoding 135 can transcode the videostream 130 based on a type of the client network 175. For example, ifthe client network 175 is a metered connection such as a cellular dataconnection, the user 170 may want to minimize the usage of data, and thetranscoding 135 can transcode the video stream 130 to a lower resolutionto minimize the data consumption. Continuing with the example, if thesource video stream 130 is of 4K resolution, the transcoding 135 cantranscode the video stream 130 to a lower resolution such as Full-HD orHD.

The base station 105 can also adapt the transcoding 135 dynamicallybased on the input parameters. That is, the base station 105continuously monitors the input parameters, and changes the transcoding135 (if necessary) if there is a change in one or more of the inputparameters. For example, if the downlink data rate of the client network175 changes beyond a specified threshold, e.g., decreases from a firstbit rate to a second bit rate, the base station 105 can automaticallylearn of the decrease in the downlink data rate, and transcode the videostream 130 by decreasing a resolution and/or bit rate of the videostream 130 to generate an adjusted transcoded video stream. Similarly,the base station 105 can have the transcoding 135 increase theresolution and/or the bit rate back up when the downlink rate of theclient network 175 improves beyond a specified threshold. In anotherexample, as the availability of memory on an access point of the clientnetwork 175 to which the user device 165 is connected decreases, thebase station 105 can have the transcoding 135 decrease the bit rate ofthe video stream 130 from a first bit rate to a second bit rate, sincethe access point may not be able to buffer enough data packets.

The base station 105 can monitor the input parameters using variousmeans. For example, the base station 105 can obtain network parametersassociated with the client network 175 from an access point of theclient network 175 through which the user device 165 is connected. Thenetwork parameters can include a data rate of the client network 175, aload of the client network 175, a latency of the client network 175,memory availability at the access point. In another example, the basestation 105 can obtain network parameters associated with the clientnetwork 175 and user device parameters from an app, such as a videoplayer that plays the video stream, installed at the user device 165.The app can identify device parameters such as a type of the user device165, a resolution of the user device 165, a type of the operating systemof the user device 165, and other hardware and software capabilities ofthe user device 165. The app can also provide information such as a timeof arrival of data packets of the transcoded video stream 150 at theuser device 165, any loss in data packets, which can be analyzed by thebase station 105 to determine or derive various network patterns such asany delay in receipt of the data packets, any congestion in the clientnetwork 175, a latency of the client network 175, etc., which can thenbe used to transcode the video stream 130 accordingly.

Transcoding the video stream 130 at the base station 105 can havevarious advantages (which are described in the following paragraphs).However, the transcoding 135 is not limited to being performed in thebase station 105. The base station 105 can have the transcoding 135performed in the video streaming server 180 of the cloud network 140, asillustrated in FIG. 2.

FIG. 2 is a block diagram of an example 200 in which transcoding of avideo stream is performed in a video streaming server in a cloudnetwork, consistent with various embodiments. In the example 200, whenthe video player on the user device 165 requests the video stream 130,the base station 105 uploads the video stream 130 to the video streamingserver 180 in the cloud network 140, which performs the transcoding 135of the video stream 130 to generate the transcoded video stream 150 andfurther streams the transcoded video stream 150 to the user device 165.The user device 165 maintains a continuous connection with the videostreaming server 180 to receive the transcoded video stream 150. Theinput parameters based on which the transcoding 135 is performed isdetermined by the video streaming server 180, base station 105 or both.

The base station 105 can dynamically determine the “transcode at”location, e.g., base station 105 or the video streaming server 180,based on a transcoding location parameter. The transcoding locationparameter is evaluated based on one or more transcoding location factorsand is evaluated to one of two values, e.g., Boolean values such as trueor false, 0 or 1, “LOCAL” or “REMOTE,” etc. If the base station 105determines that the transcoding location parameter is of a first value,e.g., LOCAL, the transcoding 135 is performed at the base station 105,and if the transcoding location parameter is of a second value, e.g.,REMOTE, the base station 105 instructs the video streaming server 180 toperform the transcoding 135. The transcoding location parameter isdetermined based on one or more transcoding location factors, whichinclude parameters associated with the base station 105 such as hardwareor software capabilities of the base station 105; parameters associatedwith the video streaming server 180 such as a latency, load or alocation of the video streaming server 180, a licensing cost associatedwith the transcoding at the video streaming server 180; user deviceparameters such as a location of the user device 165; network parametersassociated with the client network 175 such as whether the clientnetwork 175 supports P2P streaming, etc.

For example, if the base station 105 determines that the base station105 has a hardware transcoding component, or availability of resourcessuch as processing capacity, memory, is above a specified threshold,then the base station 105 determines the transcoding location parameteras “LOCAL,” which indicates that the transcoding 135 is performed at thebase station 105. In another example, if the base station 105 determinesthat a latency or a load associated with the video streaming server 180is above a specified threshold, if there is a licensing cost associatedwith the transcoding 135 at the video streaming server 180, or if thelicensing cost is above a specified threshold, the base station 105determines the transcoding location parameter as “LOCAL.” In yet anotherexample, if the base station 105 determines that the user device 165 islocated in (a) the same network as the base station 105, e.g., the firstnetwork 125, or (b) a network in which the latency between the basestation 105 and the user device 165 is lesser than a latency between thevideo streaming server 180 and the user device 165, the base station 105determines the transcoding location parameter as “LOCAL.”

If the base station 105 determines that resources, such as a processingcapacity, a memory, are unavailable, or their availability is below aspecified threshold for performing the transcoding 135, the base station105 determines the transcoding location parameter as “REMOTE,” whichindicates that the base station 105 would instruct the video streamingserver to perform the transcoding 135. In another example, if the basestation 105 determines that base station 105 does not satisfy aparticular transcoding requirement, e.g., a specified codec isunavailable, the base station 105 determines the transcoding locationparameter as “REMOTE.” In another example, if the base station 105determines that a latency or a load associated with the video streamingserver 180 is below a specified threshold, if there is no licensing costassociated with the transcoding 135 at the video streaming server 180,or if the licensing cost is below a specified threshold, the basestation 105 determines the transcoding location parameter as “REMOTE,”In yet another example, if the base station 105 determines that theclient network 175 does not permit P2P streaming, the base station 105determines the transcoding location parameter as “REMOTE.”

The base station 105 can continuously monitor the transcoding locationfactors, e.g., by obtaining feedback from the user device 165, from thevideo streaming server 180, or an access point of the client network175, determine the transcoding location parameter, and dynamically adaptthe transcode at location based on the transcoding location parameter.For example, while the base station 105 is transcoding 135 a firstportion of the video stream 130 at the base station 105, it candetermine that the transcoding location parameter has changed, andtherefore, instruct the video streaming server 180 to transcode the nextportion or a remaining portion of the video stream 130.

The video streaming server 180 can be one server which performs both thetranscoding 135 of the video stream 130 and streaming of the transcodedvideo stream 150, or can be more than one server in the cloud network140—one server transcoding 135 of the video stream 130 and anotherserver streaming the transcoded video stream 150.

FIG. 3 is a block diagram of the base station of FIG. 1A, consistentwith various embodiments. The base station 105 has multiple componentsincluding a network component 305, a monitoring component 310, atranscoding component 315, and a transceiver component 320. The networkcomponent 305 establishes the connection with the first network 125, andbetween the base station 105 and the camera 110.

The monitoring component 310 monitors various parameters, such as inputparameters that can be used in determining a form to which the videostream 130 is to be transcoded; streaming location parameter that can beused to determine the streaming from location, transcoding locationparameter that can be used to determine the transcode at location.

The transcoding component 315 performs the transcoding 135 of the videostream 130 from a first form to a second form based on one or more ofthe input parameters.

The transceiver component 320 receives a video stream from the camera110. The transceiver component 320 can store video streams at and/orretrieve the video streams from various storage sites such as thestorage device 115, NAS or a cloud storage service. The transceivercomponent 320 can receive user requests for live video streams from thecamera 110 or recorded video streams stored at the various storage sitesand transmit them to the users.

Additional details of the foregoing components are described at leastwith reference to FIGS. 4-6 below. Note that the base station 105illustrated in FIG. 3 is not restricted to having the above components.The base station 105 can include lesser number of components, e.g.,functionalities of two components can be combined into one component, orcan include more number of components, e.g., components that performother functionalities. In some embodiments, the functionalities of oneor more of the above components can be split into two or morecomponents. Furthermore, the components of the base station 105 can beimplemented at a single computing device or distributed across multiplecomputing devices,

FIG. 4 is a flow diagram of a process 400 for transcoding a video streamin a camera system having a base station, consistent with variousembodiments. In some embodiments, the process 400 can be implementedusing the base station 105 of FIG. 1A. At block 405, the networkcomponent 305 establishes a network connection between the base station105 and the camera 110 in the first network 125. For example, thenetwork component 305 can connect the base station 105 to the firstnetwork 125, either wirelessly or using wired means, discover the camera110 in the first network 125 and connect to the camera 110, again eitherwirelessly or using wired means.

At block 410, the transceiver component 320 receives a request from theuser 170 for a video stream 130 that is captured using the camera 110.The video stream 130 can be a real-time video stream from the camera 110or a recording that is stored at one of the various storage sites. Thevideo stream 130 can also include audio data.

At block 415, the monitoring component 310 determines multiple inputparameters that may be used in determining to which form the videostream 130 is to be transcoded. The input parameters can include userdevice parameters, server parameters, network parameters associated withthe first network 125, network parameters associated with the cloudnetwork 140, and network parameters associated with the client network175. The monitoring component 310 can also monitor streaming locationparameter that can be used to determine the streaming from location andtranscoding location parameter that can be used to determine thetranscode at location.

At block 420, the transcoding component 315 transcodes the video stream130 from a first form to a second form based on one or more of themultiple input parameters. For example, if the video stream is of 4Kresolution and the user device 165 requesting the video stream 130 has adisplay with 720p resolution, the transcoding component 315 transcodesthe video stream 130 from 4K to 720p by generating the transcoded videostream 150 at the 720p resolution. It should be noted that thetranscoding 135 can either be performed at the base station 105 by thetranscoding component 315, or by a video streaming server 180 in thecloud network 140. The base station can make the decision of thetranscode at location based on the transcoding location parameter.

At block 425, the transceiver component 320 can transmit the transcodedvideo stream 150 to the user device 165. The transceiver component 320can either stream the transcoded video stream 150 to the user device 165directly, e.g., using P2P streaming, or forward the transcoded videostream 150 to a video streaming server 180 in the cloud network 140 tostream the transcoded video stream 150 to the user device 165. Thetransceiver component 320 determines the streaming from location basedon a value of the streaming location parameter, which is determined bythe monitoring component 310 based on one or more streaming locationfactors.

The transcoded video stream 150 can be streamed using one of manytransport protocols, such as HTTP Live Streaming, Dynamic AdaptiveStreaming Over HTTP (DASH), Smooth Streaming, HTTP Dynamic Streaming(HDS), MPEG-DASH, WEBRTC or Progressive Download as backup plan. In someembodiments, streaming services such as Wowza can also be used forstreaming the transcoded video stream 150.

FIG. 5 is a flow diagram of a process 500 for dynamically adapting thetranscoding of a video stream, consistent with various embodiments. Theprocess 500 may be executed using the base station 105 of FIG. 1A andcan be executed as part of block 420 of process 400. At block 505, themonitoring component 310 continues to monitor the input parameters thatmay be used in determining to which form the video stream 130 is to betranscoded. The input parameters can include user device parameters,server parameters, network parameters associated with the first network125, network parameters associated with the cloud network 140, andnetwork parameters associated with the client network 175. Themonitoring component 310 can obtain the input parameters from, or deriveat least some of the input parameters based on the information obtainedfrom, the user device 165, the video streaming server 180, or an accesspoint of the client network 175.

At determination block 510, the monitoring component 310 determineswhether any of the input parameters have changed beyond a specifiedthreshold. In some embodiments, a user can define the threshold for acorresponding parameter.

If the monitoring component 310 determines that a specified inputparameter has not changed beyond a specified threshold, the process 500returns to block 505 where the monitoring component 310 continues tomonitor the input parameters.

If the monitoring component 310 determines that the specified inputparameter has changed beyond a specified threshold, at block 515, thetranscoding component 315 adjusts the transcoding of the video stream130 to generate an adjusted transcoded video stream. For example,consider that a downlink rate of the client network 175 is 15 Mbps andthe transcoding component 315 is streaming a transcoded the video stream130 at 4K resolution at 13 Mbps. If the monitoring component 310determines that the downlink data rate of the client network 175 haschanged beyond a specified threshold, e.g., decreased by more than 50%to 6 Mbps rate, the monitoring component 310 can automatically learn ofthe decrease in the downlink data rate, and instruct the transcodingcomponent 315 to decrease a resolution and/or bit rate of the videostream 130 to Full HD at 6 Mbps. In response, the transcoding component315 generates an adjusted transcoded video stream of Full HD resolutionat 6 Mbps.

In some embodiments, the base station 105 can also instruct the camera110 to modify one or parameters associated with the camera 110 based onfeedback obtained by the base station 105. For example, the user 170 canprovide feedback, e.g., using the app at the user device 165 which theuser 170 uses to stream the video, indicating that night-vision imagesare not clear as the images are dark and the subject is not visible inthe image. Upon receiving such feedback, the monitoring component 310can either instruct the transcoding component 315 to enhance the videostream 130, e.g., by digitally increasing a gain, or instruct the camera110 to enhance the video stream 130, e.g., by modifying one or moreparameters associated with a sensor of the camera 110, such that theimages in the video are brighter and the subject is visible. In anotherexample, the user 170 can provide feedback indicating that the colors inthe day-vision images are not appropriate or accurate. Upon receivingsuch feedback, the monitoring component 310 can either instruct thetranscoding component 315 to enhance the video stream 130, e.g., bydigitally processing the colors, or instruct the camera 110 to enhancethe video stream 130, e.g., by changing the color mapping when encodingthe video prior to transmission to the base station 105, such that thecolors in the video have better accuracy. The base station 105 can notonly dynamically adapt the transcoding based on the feedback it can alsomodify the parameters of the camera 110 to capture images based on userpreferences.

FIG. 6 is a flow diagram of a process 600 for determining a transcodinglocation of a video stream; consistent with various embodiments. Theprocess 600 may be executed in the base station 105 of FIG. 1A, and insome embodiments, as part of block 420 of process 400. At block 605, themonitoring component 310 monitors the transcoding location factors,which are described at least with reference to FIG. 2.

At block 610, the monitoring component 310 evaluates a transcodinglocation parameter based on the transcoding location factors. In someembodiments, the transcoding location parameter is evaluated to one oftwo values—“LOCAL” and “REMOTE”—in which the value “LOCAL,” indicatesthat the transcoding 135 is performed at the base station 105, and thevalue “REMOTE” indicates that the transcoding is performed at the videostreaming server 180. Note that the evaluation function can consider onefactor or a combination of factors in determining the value. Also, insome embodiments, the user 170 may customize the evaluation function todetermine a specific value for specific combination of factors.

At determination block 615, the monitoring component 310 determineswhether the value of the transcoding location parameter is “LOCAL,” or“REMOTE.” For example, if the base station 105 determines that the basestation 105 has a hardware transcoding module; availability of resourcessuch as processing capacity, memory, is above a specified threshold; alatency or a load associated with the video streaming server 180 isabove a specified threshold; if there is a licensing cost associatedwith the transcoding 135 at the video streaming server 180; if thelicensing cost is above a specified threshold, the monitoring component310 determines the transcoding location parameter as “LOCAL.” If themonitoring component 310 determines that resources at the base station105, such as a processing capacity, a memory, are unavailable, or theiravailability is below a specified threshold for performing thetranscoding 135; that the base station 105 does not satisfy a particulartranscoding requirement, e.g., a specified codec is unavailable, thebase station 105 determines the transcoding location parameter as“REMOTE.”

If the monitoring component 310 determines that a value of thetranscoding location parameter is “LOCAL,” at block 620, the monitoringcomponent 310 instructs the transcoding component 315 to perform thetranscoding 135.

On the other hand, if the monitoring component 310 determines that avalue of the transcoding location parameter is “REMOTE,” at block 625,the monitoring component 310 instructs the transceiver component 320 totransmit the video stream 130 to a video streaming server 180 in thecloud network 140 for performing the transcoding 135.

FIG. 7 is a block diagram of a computer system as may be used toimplement features of some embodiments of the disclosed technology. Thecomputing system 700 may be used to implement any of the entities,components or services depicted in the foregoing figures (and any othercomponents described in this specification). The computing system 700may include one or more central processing units (“processors”) 705,memory 710, input/output devices 725 (e.g., keyboard and pointingdevices, display devices), storage devices 720 (e.g., disk drives), andnetwork adapters 730 (e.g., network interfaces) that are connected to aninterconnect 715. The interconnect 715 is illustrated as an abstractionthat represents any one or more separate physical buses, point to pointconnections, or both connected by appropriate bridges, adapters, orcontrollers. The interconnect 715, therefore, may include, for example,a system bus, a Peripheral Component Interconnect (PCI) bus orPCI-Express bus, a HyperTransport or industry standard architecture(ISA) bus, a small computer system interface (SCSI) bus, a universalserial bus (USB), IIC (I2C) bus, or an Institute of Electrical andElectronics Engineers (IEEE) standard 1394 bus, also called “Firewire”.

The memory 710 and storage devices 720 are computer-readable storagemedia that may store instructions that implement at least portions ofthe described technology. In addition, the data structures and messagestructures may be stored or transmitted via a data transmission medium,such as a signal on a communications link. Various communications linksmay be used, such as the Internet, a local area network, a wide areanetwork, or a point-to-point dial-up connection. Thus, computer-readablemedia can include computer-readable storage media (e.g.,“non-transitory” media) and computer-readable transmission media.

The instructions stored in memory 710 can be implemented as softwareand/or firmware to program the processor(s) 705 to carry out actionsdescribed above. In some embodiments, such software or firmware may beinitially provided to the processing system 700 by downloading it from aremote system through the computing system 700 (e.g., via networkadapter 730).

The technology introduced herein can be implemented by, for example,programmable circuitry (e.g., one or more microprocessors) programmedwith software and/or firmware, or entirely in special-purpose hardwired(non-programmable) circuitry, or in a combination of such forms.Special-purpose hardwired circuitry may be in the form of, for example,one or more ASICs, PLDs, FPGAs, etc.

Although the invention is described herein with reference to thepreferred embodiment, one skilled in the art will readily appreciatethat other applications may be substituted for those set forth hereinwithout departing from the spirit and scope of the present invention.Accordingly, the invention should only be limited by the claims includedbelow.

We claim:
 1. A method comprising: establishing a network connectionbetween a base station and a video camera in a first network; receiving,at the base station and from a user device associated with a user, arequest for viewing a video stream that is captured by the video camera;determining, at the base station, multiple input parameters fortranscoding the video stream, wherein at least some of the inputparameters are associated with the user device; transcoding, at the basestation, the video stream based on one or more of the multiple inputparameters to generate a transcoded video stream; and transmitting thetranscoded video stream from the base station to the user device;wherein the input parameters for transcoding the video stream include afirst set of network parameters associated with the first network, saidfirst set of parameters comprising uplink data rate, a second set ofparameters associated with the user device, said second set ofparameters comprising any of a resolution of the user device, a type ofnetwork connection at the user device, hardware and/or softwarecapabilities of the user device, or a battery state of the user device,and a third set of parameters associated with a video streaming serverthat transmits the transcoded video stream to the user device, saidthird set of set of parameters comprising any of a network speed, aload, a data rate, or an outage of a network associated with the userdevice, an amount of memory available at video streaming server,processing capacity of the video streaming server, or a latency of thevideo streaming server.
 2. The method of claim 1, wherein establishingthe network connection includes receiving the video stream from thevideo camera at the base station.
 3. The method of claim 1, whereintranscoding the video stream includes: receiving, at the base station,the video stream from the video camera as a real-time video stream, andtranscoding the real-time video stream to generate the transcoded videostream.
 4. The method of claim 1, wherein transcoding the video streamincludes: retrieving, at the base station, the video stream from astorage device associated with the base station, wherein the videostream received from the video camera is stored at the storage device,and transcoding the video stream from the storage device to generate thetranscoded video stream.
 5. The method of claim 1, wherein transmittingthe transcoded video stream includes transmitting the transcoded videostream from the base station to a video streaming server in a secondnetwork for transmission to the user device.
 6. The method of claim 1,wherein transmitting the transcoded video stream includes transmittingthe transcoded video stream from the base station to the user deviceusing a peer-to-peer (P2P) streaming technique.
 7. The method of claim6, wherein transmitting the transcoded video stream using the P2Pstreaming technique includes exchanging signaling information betweenthe base station and the user device via a server in a second networkfor P2P transmission of the transcoded video stream.
 8. The method ofclaim 1, wherein transmitting the transcoded video stream includesdetermining, at the base station, whether to transmit the transcodedvideo stream to the user device using a P2P streaming technique or via avideo streaming server based on parameters associated with at least oneof the video streaming server or a third network in which the userdevice is located.
 9. The method of claim 8 further comprising:responsive to a determination that a network latency associated with thethird network is above a specified threshold, transmitting thetranscoded video stream to the video streaming server for transmissionto the user device.
 10. The method of claim 8 further comprising:responsive to a determination that a network latency associated with thethird network is below a specified threshold, transmitting thetranscoded video stream to the user device using the P2P streamingtechnique.
 11. The method of claim 8 further comprising: responsive to adetermination that a load associated with the video streaming server isabove a specified threshold, transmitting the transcoded video stream tothe user device using the P2P streaming technique.
 12. The method ofclaim 1, wherein the first set of network parameters includes an uplinkdata rate of the base station in the first network to send thetranscoded video stream.
 13. The method of claim 12 further comprising:determining that the uplink data rate decreased from a first value to asecond value, and transcoding the video stream to decrease a bit rate ofthe video stream, wherein the bit rate in the transcoded video stream isdecreased from a third value to a fourth value.
 14. The method of claim1, wherein transcoding the video stream includes: determining that thedata rate of the second network increased from a first value to a secondvalue, and adjusting the transcoding to increase a resolution of thevideo stream from a second value to a third value to generate anadjusted transcoded video stream.
 15. The method of claim 1, whereindetermining the input parameters includes: determining at least someparameters from the second set of parameters using an app installed onthe user device.
 16. The method of claim 1, wherein determining theinput parameters includes: determining at least some parameters from thesecond set of parameters using an access point associated with the userdevice.
 17. The method of claim 1, wherein transcoding the video streamincludes: determining that one of the input parameters changed, andadjusting the transcoding to generate an adjusted transcoded videostream.
 18. A computer-readable storage medium storing computer-readableinstructions, comprising: instructions for receiving, at a base stationin a first network and from a user device associated with a user, arequest for viewing a video stream that is captured by a video cameraassociated with the base station; instructions for determining whether atranscoding location parameter is of a first value or a second value;instructions for determining to transcode the video stream at the basestation if the transcoding location parameter is of the first value;instructions for determining to transcode the video stream at a videostreaming server in a second network if the transcoding locationparameter is of the second value; instructions for transcoding the videostream based on multiple input parameters to generate a transcoded videostream; and instructions for transmitting the transcoded video stream tothe user device; wherein the input parameters for transcoding the videostream include a first set of network parameters associated with thefirst network, said first set of parameters comprising uplink data rate,a second set of parameters associated with the user device, said secondset of parameters comprising any of a resolution of the user device, atype of network connection at the user device, hardware and/or softwarecapabilities of the user device, or a battery state of the user device,and a third set of parameters associated with a video streaming serverthat transmits the transcoded video stream to the user device, saidthird set of set of parameters comprising any of a network speed, aload, a data rate, or an outage of a network associated with the userdevice, an amount of memory available at video streaming server,processing capacity of the video streaming server, or a latency of thevideo streaming server.
 19. The computer-readable storage medium ofclaim 18, wherein the instructions for determining whether thetranscoding location parameter is of the first value or the second valueinclude: instructions for determining that the transcoding locationparameter is of the first value in an event the base station has ahardware transcoding component, a latency or load of the video streamingserver is above a specified threshold, or the user device is in thefirst network.
 20. The computer-readable storage medium of claim 18,wherein the instructions for determining whether the transcodinglocation parameter is of the first value or the second value include:instructions for determining that the transcoding location parameter isof the second value in an event the user device is incapable ofreceiving the video stream using a P2P streaming technique.
 21. Thecomputer-readable storage medium of claim 18, wherein the instructionsfor transcoding the video stream include: instructions for determiningthat a first resolution of the user device is lesser than a secondresolution at which the video stream is encoded by the video camera,wherein the first resolution is one of the input parameters, andinstructions for transcoding the video stream to the first resolution.22. The computer-readable storage medium of claim 18, wherein theinstructions for transcoding the video stream include: instructions fordetermining that a data rate associated with a third network in whichthe user device is located increased from a first data rate to a seconddata rate, wherein the data rate is one of the input parameters, andinstructions for increasing a quality of the video stream by transcodingthe video stream from a first bit rate to a second bit higher than thefirst bit rate.
 23. The computer-readable storage medium of claim 18,wherein the instructions for transcoding the video stream include:instructions for receiving a feedback from the user device, the feedbackindicating that the user device is experiencing a data loss in receivingthe video stream, and instructions for transcoding the video stream froma first bit rate to a second bit lower than the first bit rate.
 24. Thecomputer-readable storage medium of claim 18, wherein the instructionsfor transcoding the video stream include: instructions for receiving afeedback from the user device, the feedback indicating that the userdevice has a video decoder of a specified protocol, and instructions fortranscoding the video stream to encode the video stream to the specifiedprotocol.
 25. A base station, comprising: a processor; a networkcomponent that is configured to establish a connection with a firstnetwork and to a video camera in the first network; a monitoringcomponent that is configured to monitor multiple input parameters fortranscoding a video stream; a transcoding component that is configuredto transcode the video stream based on one or more of the multiple inputparameters to generate a transcoded video stream; and a transceivercomponent that is configured to: receive the video stream from the videocamera, and transmit the transcoded video stream to a user device;wherein the input parameters for transcoding the video stream include afirst set of network parameters associated with the first network, saidfirst set of parameters comprising uplink data rate, a second set ofparameters associated with the user device, said second set ofparameters comprising any of a resolution of the user device, a type ofnetwork connection at the user device, hardware and/or softwarecapabilities of the user device, or a battery state of the user device,and a third set of parameters associated with a video streaming serverthat transmits the transcoded video stream to the user device, saidthird set of set of parameters comprising any of a network speed, aload, a data rate, or an outage of a network associated with the userdevice, an amount of memory available at video streaming server,processing capacity of the video streaming server, or a latency of thevideo streaming server.
 26. The base station of claim 25, wherein theinput parameters include network parameters associated with the firstnetwork, and wherein the monitoring component is configured to obtainthe network parameters from an access point of the first network. 27.The base station of claim 25, wherein the input parameters includenetwork parameters associated with a second network to which the userdevice is connected.
 28. The base station of claim 27, wherein themonitoring component is configured to obtain the network parameters froman access point of the second network.
 29. The base station of claim 27,wherein the monitoring component is configured to obtain the networkparameters from an app executing at the user device.
 30. The basestation of claim 27, wherein the monitoring component is configured todetermine that a type of network connection of the user device changedfrom a first type to a second type, and wherein the transcodingcomponent is configured to transcode the video stream to lower a qualityof the video stream by transcoding the video stream from a first bitrate to a second bit lower than the first bit rate.
 31. The base stationof claim 25, wherein the monitoring component is configured to receivefeedback from the user device indicating that a visibility of subjectsin the video stream in a night vision mode of the video camera is belowa specified threshold, and wherein the transceiver component isconfigured to send instructions to the video camera to modify one ormore image capturing parameters associated with the video camera toimprove the visibility.
 32. The base station of claim 25, wherein thetransceiver component is configured to: stream the transcoded videostream to the user device using a P2P streaming technique, or transmitthe transcoded video stream to a video streaming server in a secondnetwork for streaming to the user device.
 33. The base station of claim25, wherein the transceiver component is configured to: determine thatthe user device is in the first network, and stream the transcoded videostream from the base station to the user device directly, or via anaccess point of the first network.